# -*- coding: utf-8 -*-
'''
Created on 2013-4-16

@author: chenkaode@baidu.com
'''
from PhoneUtil import PhoneUtil
from CommonUtil import CommonUtil
from constant.Constant import Constant
import os
import sqlite3

class UbcUtil:
    
    @classmethod
    def db25m(cls):
        cmd = "adb push " + Constant.UBC_DB_25MB + " " + Constant.UBC_DB_PHONE
        CommonUtil.execWithoutRet(cmd)
    
    @classmethod
    def db50k(cls):
        cmd = "adb push " + Constant.UBC_DB_50KB + " " + Constant.UBC_DB_PHONE
        CommonUtil.execWithoutRet(cmd)
    
    @classmethod
    def db1001(cls):
        cmd = "adb push " + Constant.UBC_DB_1001 + " " + Constant.UBC_DB_PHONE
        CommonUtil.execWithoutRet(cmd)
    
    @classmethod
    def DBContent(cls):
        cmd = "adb pull " + Constant.UBC_DB_PHONE + " " + Constant.UBC_DB_DIR + os.sep + "ubc.db"
        CommonUtil.execWithoutRet(cmd)
        cx = sqlite3.connect(Constant.UBC_DB)
        cur = cx.cursor()
        cur.execute("SELECT _id,metric_id from metric_table;")
        inf = cur.fetchall()
        print inf
        return inf
    
    @classmethod
    def showRegPrefs(cls):
        pass
    
    @classmethod
    def showProfile(cls):
        pass
    
    @classmethod
    def delProfile(cls):
        pass